<?php
include '../c/config.php';
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqli->error);}

$nianJi=array(
	3 => '三年级',
	4 => '四年级', 
	5 => '五年级',  
);
$qu=['徐汇区','杨浦区','七宝小学联合体','金山区','嘉定区','奉贤区','宝山区','崇明区','普陀区','松江区','浦东新区','虹口区','长宁区','闵行区','青浦区','静安区','黄浦区'];
$quName=['xuhui','yangpu','qibaoxiaoxue','jinshan','jiading','fengxian','baoshan','chongming','putuo','songjiang','pudongxinqu','hongkou','changning','minhang','qingpu','jingan','huangpu'];

foreach ($nianJi as $kNian => $vNian) {
	 echo $vNian.'数据： ';
	 echo "<br />";
	 foreach ($quName as $key => $value) {
		 $query=$mysqli->query("SELECT COUNT(id) as COUNT FROM `uinfo` WHERE `hui`='".$value."' and nianji=".$kNian." ");
		 
		 $getD=$query->fetch_array();
		 echo $qu[$key];
		 echo " 参与人数: ";
		 echo $getD['COUNT'];
		 echo "<br />";
     }

     echo "<br /><br /><br />";

}






 
$mysqli->close();
 